function  dv_dlambda =  bond_pricing_ode_lambda(  lambda, v, par,  model_sol,  w,  v_fitted_lambda )
% This function solves v(w, lambda) as a function lambda for either w=0, or w=1. 
% v_fitted_lambda is the function v along the lambda dimension, for the fixed w.
% Other values
if(w==0)
    rf = model_sol.rf0;
elseif(w==1)
    rf = model_sol.rf1;
end

tau=par.tau;   pi=par.pi;    hat_kappa0 = par.hat_kappa0;
mu_lambda = par.mu_lambda_fun(lambda);
jump_lambda = par.kappa_lambda_fun(lambda);
lambda_tau = 1/tau - pi*lambda;
kappab = model_sol.kappab_fitted_matrix( w, lambda );

dv_dlambda = ( rf*v + lambda*pi/(1-kappab)*(v-(1-hat_kappa0)) + lambda*(1-pi)/(1-kappab)*( v_fitted_lambda(lambda) - v_fitted_lambda(lambda+jump_lambda) ) + lambda_tau .* (v-1)   )/ mu_lambda;












